Dynomotion

Group: DynoMotion Message: 4507 From: Michael Rosenfield Date: 4/6/2012
Subject: KMotionCNC questions

 Tom,
Just to remind you: I have retrofitted a Tree knee mill with table x,y, quill z and knee extra z.
Does KmotionCMC support MPG? 4th axis? If so, how do I enable them?
I created an init file, based on one supplied, but am I correct in assuming it's better to download it each time the system is powered up than to load it to flash?
Does this mean that every time I bring up KMotionCNC, the first thing I do is hit the Init button?
I attached the init file, in case you want to see it.
All 4 axes are working pretty well, although there may be a little tweaking left to do here and there.
 
Thanks,
Michael
  @@attachment@@
Group: DynoMotion Message: 4508 From: Tom Kerekes Date: 4/6/2012
Subject: Re: KMotionCNC questions [1 Attachment]
Hi Michael,
 
I see your Init.c code has a loop for an MPG included.  Do you have an MPG?  Did you wire it up?
 
For a 4th axes just enable axis channel 3 and add it to the DefineCoordSystem.
 
Yes normally an Init button is used to configure everything and enable the system.  We don't recommend flashing it.
 
Regards
TK

Group: DynoMotion Message: 4509 From: Michael Rosenfield Date: 4/6/2012
Subject: Re: KMotionCNC questions
Yes, it is wired up.  I can't figure out how to use it with KMotionCNC, though.
Does DefineCoordSystem change what KMotionCNC displays? There are only 3 axis displayed.
 
Michael
 
Group: DynoMotion Message: 4510 From: Tom Kerekes Date: 4/6/2012
Subject: Re: KMotionCNC questions
Hi Michael,
 
There is nothing really to set up in KMotionCNC.  Just turn the MPG and the axis selected on the MPG should move.  Did you check on the Digital IO screen that all the switches and encoder A/B inputs toggle correctly?
 
in KMotionCNC under Too Setup | ToolSetup File | Main Dialog Face you can change to Basic 4 axes
 
Regards
TK
 

Group: DynoMotion Message: 4511 From: Michael Rosenfield Date: 4/6/2012
Subject: Re: KMotionCNC questions
How do I select an axis for the MPG?  I don't see anything obvious on the CNC screen.
All what switches? I've checked the limit switches. I haven't checked this encoder yet.
 
Michael
 
Group: DynoMotion Message: 4512 From: Tom Kerekes Date: 4/6/2012
Subject: Re: KMotionCNC questions
Hi Michael,
 
There is nothing on the KMotionCNC Screen to set up.  Normally an MPG is as shown here.
 
 
The MPG C program you have included is expecting such switches to be wired up.
 
What kind of MPG do you have?  How did you wire it? 
 
You should check that the encoder AB signals are toggling on the Digial IO Screen first.
 
Regards
TK
 
 
 
Group: DynoMotion Message: 4513 From: Michael Rosenfield Date: 4/6/2012
Subject: Re: KMotionCNC questions
I have a similar MPG, but it is the knob and encoder only. I wired it to Kanalog encoder ch3.
I don't want a pendant, and don't have axis or step switches. I could add them.
How difficult would it be to add these functions to the KMotionCNC screen?
 
Michael
Group: DynoMotion Message: 4514 From: Tom Kerekes Date: 4/6/2012
Subject: Re: KMotionCNC questions
Hi Michael,
 
You could use 6 KMotionCNC User buttons to select the Axis and MPG Rate.  Unfortunately there wouldn't be any indication of what axis was selected.
 
Again please check that the encoder AB signals are toggling on the Digial IO Screen.
 
This section of the MPG Program selects the axis that the MPG moves.  If none of these are set then no axis will move (which is probably why there is no motion):
 
  if (ReadBit(28))  // is x selected?
      ch0->Dest += Change1 * Factor;
  else if (ReadBit(29))  // is y selected?
      ch1->Dest += Change1 * Factor;
  else if (ReadBit(30))  // is z selected?
      ch2->Dest += Change1 * Factor;
 
Let's change these to Virtual IO bits 48,49,50 (instead of real inputs 28,29,30).
 
Then use the Digital IO screen in KMotion.exe to set one of the Virtual Bits High and see if that axis indeed moves.
 
If that all works you could create User buttons to set one of 3 bits.  ie:
 
    SetBit(48);
    ClearBit(49);
    ClearBit(50);
 
Regards
TK
 
 
 
 
 
Group: DynoMotion Message: 4551 From: Michael Rosenfield Date: 4/12/2012
Subject: Re: KMotionCNC questions
TK,
What would it take to use the radio buttons for step size already on the KMotionCNC screen for the MDI step size as well?
 
Thanks,
Michael
 
Group: DynoMotion Message: 4552 From: Tom Kerekes Date: 4/12/2012
Subject: Re: KMotionCNC questions
Hi Michael,
 
You should look through the code and see if you can understand things.  Open the BuildExample solution to see if you can re-build the code and set breakpoints.  To be able to debug you will need to open the BuildAllLibs solution and build the debug versions of all the libraries.  This just involves opening the solutions and select build solution.
 
Here are the event functions in KMotionCNC that are called when the user makes step size selections
 
void
CKMotionCNCDlg::OnStep0()
{
UpdateData();
}
void
CKMotionCNCDlg::OnStep1()
{
UpdateData();
}
void
CKMotionCNCDlg::OnStep2()
{
UpdateData();
}
void
CKMotionCNCDlg::OnStep3()
{
UpdateData();
}
void
CKMotionCNCDlg::OnStep4()
{
UpdateData();
}
void
CKMotionCNCDlg::OnStep5()
{
UpdateData();
}
 
Currently all that happens is all the screen control data is updated into member variables which includes
 
DDX_Radio(pDX, IDC_Step0, m_StepSize);
 
You might then insert calls to do something like set a persist variable in KFLOP with
 
TheFrame->KMotionDLL->WriteLine(
"SetPersistDec 20 4");
 
Your KFLOP MPG program could then check the persist variable to use the appropriate step size
 
Good luck
TK